use std::fmt::Debug;
trait Eat {
    fn eat(&self)
    where
        Self: Debug,
    {
        println!("eat {:?}", self);
    }
}

trait Code {
    fn code(&self) {
        println!("code")
    }
}
trait Sleep {
    fn sleep(&self) {
        println!("sleep")
    }
}

trait Programmer: Eat + Code + Sleep {
    fn animate(&self) where Self:Debug{
        self.eat();
        self.code();
        self.sleep();
        println!("repeat!")
    }
}

#[derive(Debug)]
struct Bob;
impl Programmer for Bob {}
impl Eat for Bob {}
impl Code for Bob {}
impl Sleep for Bob {}

fn main() {
    Bob.animate();
}
